package com.sskj.trafficcontrol.service.impl;

import com.sskj.trafficcontrol.dao.UserIntegralDao;
import com.sskj.trafficcontrol.dao.UserSignDao;
import com.sskj.trafficcontrol.model.pojo.TcUserSign;
import com.sskj.trafficcontrol.service.UserSignService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;

@Service(value = "userSignService")
public class UserSignServiceImpl implements UserSignService {

    @Autowired
    private UserSignDao userSignDao;

    @Autowired
    private UserIntegralDao userIntegralDao;

    @Override
    public void addUserSign(String openid, String dateZero) {
        userSignDao.addUserSign(openid,dateZero);
        userIntegralDao.addIntegralDao(openid);
    }

    @Override
    public TcUserSign getUserSign(String openid) {
        return userSignDao.getUserSign(openid);
    }

    //更新签到时间
    @Override
    public void updateSignDate(String tcOpenid, String dateZero) {
        userSignDao.updateSignDate(tcOpenid,dateZero);
    }
}
